<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>headhtml.jsp</title>
<link rel="stylesheet" type="text/css" href="/css/base/${params.prefixs}headhtml.css">
</head>
<body>
	<div class="header">
		<div class="headerTopRight">
			<div class="wrap">
				<ul>
					<li class=NEWS><a href="/welcome" class="News">主页 </a></li>
					<li class=NEWS><a href="/mail" class="News">消息 <span id="unread" class="NewsBar">(0)</span></a></li>
                     <li class=USER>
                         <h1 class="User"><i></i>${login_user.name}<b></b></h1>
                         <div class="change" >
                              <a class="changePwd" href="/user/changepsw"> <i></i>修改密码</a>
                              <a class="changeExit" href="#" onclick="goexit()"> <i></i>退出</a>
                         </div>
                     </li>
                     <li><a class="SDK" href="/readword/readwordtwo">说明文档</a></li>
                     <li><a class="SDK" href="/sdk/downLast">SDK下载</a></li>
                 </ul>
			</div>				
		</div>
		<div class="wrap">
			<!-- <h1 class="my_word">ismp</h1> -->
			 <a href="/welcome">
				<img src="../../img/header/${params.prefixs}logo_ismp.png" class="logo" alt="logo"/>
			</a> 
		</div>		
		<div class="headerNav" id="menuheadid">	
		<button id="menuHeadleftAId" class="left" type="button" onclick="lshift()"></button>		
			<ul class="nav">
				<c:forEach items="${menus}" var="var">
					<li><a href="#">${var.name}</a>
						<ul>
							<c:forEach items="${var.children}" var="child">
								<li><a href="${child.directory}">${child.name}</a></li>
							</c:forEach>
						</ul>
					</li>
				</c:forEach>
			</ul>		
			<button id="menuHeadrightAId" class="right" type="button" onclick="rshift()"></button>
			
		</div>
	</div>
	<div class="headerNavBar"></div>
	
	<div class="ask">
	    <ul>
	        <li>
	            <a href="#"  class="askword asked">销售咨询</a>
	        </li>
	        <li>
	            <a href="#" class="askword asked">商务咨询</a>
	        </li>
	        <li>
	            <a href="#" class="askword asked">运营咨询</a>
	        </li>
	        <li>
	            <a href="#" class="askword customAsked">客服咨询</a>
	        </li>
	        <li>
	            <a href="#" class="askword back">返回顶部</a>
	        </li>
	        <li>
	            <button type="button" class="closeAsk">关闭</button>
	        </li>
	    </ul>
	</div>
	<div class="left_middle">
	    <h1 class="Title">移动导航</h1>
	    <ul>
	        <li><a href="#">快捷菜单一</a></li>
	        <li><a href="#">快捷菜单二</a></li>
	        <li><a href="#">快捷菜单三</a></li>
	        <li><a href="#">快捷菜单四</a></li>
	    </ul>
	    <button type="button" class="closeTitle">关闭</button>
	</div>
	 
	<script type="text/javascript">	
    $(document).ready(function() {
    	if ('${params.prefixs}' != "") {
				$(".nav li a b").remove();
			}
    	//$("#menuheadid .nav li a b").css("display","none");
        $("#menuheadid .nav li").hover(function() {
            $('ul', this).fadeIn("fast");
           // $("a b",this).slideDown("fast");
            $(this).children().addClass("hover");
            $(".headerNavBar").css({"border-top":"1px solid #c8d8e7"});
        }, function() {
            $('ul', this).fadeOut("fast");
           // $("a b",this).slideUp("fast");
            $(this).children().removeClass("hover");
            $(".headerNavBar").css({"border-top":"1px solid transparent"});
        });
        if($("#menuheadid > ul > li").length<=6){
        	 $("#menuHeadrightAId").hide();
        	 $("#menuHeadleftAId").hide();
        }
        $(".User").click(function(){
            if($(".change").css("display")=="none"){
                $(".change").slideDown();
            }else{
                $(".change").slideUp();
            }
        });
        $(".closeAsk").click(function(){        	
            $(".ask").hide();
        });
        $(".closeTitle").click(function(){        	
            $(".left_middle").hide();
        });
        //隐藏 
        //getMail();
    });
    
	//一级菜单显示顺序(1-6)
	var showNumStart = 1;
	
	var showNumEnd = 6; 
	
    var menuNum = $("#menuheadid > ul > li").length;
    
    
    $("#menuheadid > ul > li").each(function(index,demo){
    	
        if(index>showNumEnd-1){
            $(this).hide();
        }else{
            $(this).show();
        }
        
    });   
    //向右移动
    function rshift(){
    	if(showNumEnd==menuNum)return;
    	showNumEnd = showNumEnd + 1;
    	showNumStart = showNumStart + 1;
		$("#menuheadid > ul > li").each(function(index,demo){
			if(index>showNumEnd-1||showNumStart-1>index){
                $(this).hide();
            }else{
                $(this).show();
            }
		});
    }
    //向左移动
    function lshift(){
    	if(showNumStart==1)return;
    	showNumEnd = showNumEnd - 1;
    	showNumStart = showNumStart - 1;
		$("#menuheadid > ul > li").each(function(index,demo){
			if(index>showNumEnd-1||showNumStart-1>index){
                $(this).hide();
            }else{
                $(this).show();
            }
		});
    }
    //退出
    function  goexit(){
    	window.location.href='/login/logout';
    }
    function getMail(){   //获取站内信未读消息数量
	    $.ajax({
	    	url: '/mail/getUnReadCount',
	    	type: 'post',
	    	success: function (data) {
				$("#unread").html("(" + data + ")");
			}
	    });
	}
</script>
</body>
</html>
